function fn({name,time}){
    return new Promise((resolved, rejected) => {
        setTimeout(()=>{
            resolved(name);
        },time)
    })
}

let hong={name:"红色",time:2000};
let huang={name:"黄色",time:1000};
let lu={name:"绿色",time:3000};

function Color(){
    fn(hong).then(resolved=>{
        console.log(resolved);
        return fn(huang);
    }).then(resolved=>{
        console.log(resolved);
        return fn(lu);
    }).then(resolved=>{
        console.log(resolved);
        Color();
    })
}
Color()